package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.domain.SysEnumData;
import com.ruoyi.system.service.SysEnumService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 枚举字典信息
 *
 * @author BaiBan
 * @since 2023/2/12
 */
@Api(tags = "枚举字典信息")
@RestController
@RequestMapping("/system/enum/")
public class SysEnumController {

    @Autowired
    SysEnumService baseService;

    /**
     * 获取枚举值
     */
    @ApiOperation("获取枚举值")
    @GetMapping("/data/{enumName}")
    public R<List<SysEnumData>> get(@PathVariable("enumName") String enumName) {
        List<SysEnumData> enums = baseService.get(enumName);
        return R.ok(enums);
    }
}
